<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" session="false" %>
<%
	String path = request.getContextPath();
	pageContext.setAttribute("path", path);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Home</title>
<!-- ExtJS 样式 -->
<link rel="stylesheet" type="text/css" href="${path}/script/extjs-3.2.1/resources/css/ext-all.css" />
<!-- 先引入底层驱动，一般用ext自己的，如果要使用jquery的，还要先引入jquery库 -->
<script type="text/javascript" src="${path}/script/extjs-3.2.1/adapter/ext/ext-base.js"></script>
<!-- ExtJs all -->
<script type="text/javascript" src="${path}/script/extjs-3.2.1/ext-all.js"></script>
</head>
<body>
<div id="btn"></div>
<script type="text/javascript">
Ext.onReady(function(){
	// 1.window
	// 创建窗口耗用资源比较大，点击close默认会释放掉窗口
	// closeAction: "hide"，指定图标按钮方法，
	// 隐藏窗口，重复使用这些窗口，这样窗口多了浏览器不会占用太大的内存
	// 调用win.close();或者closeAction:'close'，无法再访问此窗口了
	var testWin = null;
	var btn = new Ext.Button({
		text: "点我",
		listeners: {
			click: function(){
				if(!testWin){
					alert("创建窗口");
					testWin = new Ext.Window({
						width: 300,
						height: 200,
						//closeAction: "hide",
						modal: true
					});
				}
				testWin.show();
			}
		}
	});
	btn.render("btn");
});
</script>
</body>
</html>
